home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / BOOK18.QM < prev    next >
Text File  |  1991-08-04  |  22KB  |  463 lines

  1. *                               BOOK18.QM
  2. *              Macros To Jump To BookMarks And Read Macros
  3. *                        Written by Tom Hogshead
  4. *                             August 4, 1991
  5. *  Key    Subfile              Description
  6. * =====  =========  =====================================================
  7. * @(6)  {e:\up\bok001}
  8. *                 --Select Txtfile To Load And Read Macros From Index     |chg
  9. * @(7)  {e:\up\bok001}
  10. *                 --Select And Read Macros From Index,                    |chg
  11. *                       Txtfile Not Loaded
  12. * @(8)  {e:\up\bok001}
  13. *                 --Read Macros of Subfile on Cursor Line,                |new
  14. *                       Txtfile Not Loaded
  15. * @(0)  {e:\up\bok001}
  16. *                 --Save Current Macro Buffer And                         |new
  17. *                   Read Previously Saved Macro Buffer
  18. * @(eq) {e:\up\bok001}  @=
  19. *                 --Read Current Txtfile Macros                           |new
  20. * @(mi) {e:\up\bok001}  @-
  21. *                 --Read Previously Saved Macro Buffer                    |new
  22. * @(f)  {e:\up\bok001}
  23. *                 --Jump From Index Line To Macro or Item That Is Located |chg
  24. *                   Either In Document Below Or In A Designated Subfile
  25. * ^(f1) {e:\up\bok001}
  26. *                 --Cycle Between Starting and Selected Files
  27. *                   After Invoking @6
  28. *--
  29. * @(4)            --Jump From Index Line To First Word Enclosed           |new
  30. *                   (Quicker Version of @1 That Positions
  31. *                    Cursor On First Index Selection Line)
  32. * @(1)            --Jump From Index Line To First Word Enclosed
  33. *                   With ( ) In The Document Below
  34. * @(2)            --Finds First Word On Cursor Line In Document Below,
  35. *                  "Marked" Or "Unmarked", And Encloses Selected
  36. *                   Found Word In Document With ( )
  37. * @(3)            --Copies Word At Cursor In Document To Index
  38. *                   Enclosing Word At Cursor And Word In Index With ( )
  39. * (F4)            --Continues Searching Until The Desired Word
  40. *                   Is Found In Document Below Using @2
  41. *--
  42. *    {e:\up\INDX*}--Index of Macros In AMACxx.ZIP
  43. *
  44. *  Misc
  45. * ------
  46. * (Description)    - BookMarker Macros
  47. * (Configuration)  - MUST do
  48. * (Using) Macros   - Start up and Macro Execution
  49. * (Macros)         - BookMarker Macros
  50. * (Other) Macros   - not included
  51. * (Version) history
  52. *
  53. *-- eoi
  54.  
  55.  
  56. * (Description)
  57. * --------------
  58.  
  59. *       BOOK18.QM are a series of macros enabling the user to load,
  60. *       read, and/or invoke macros located in any file.   Files, items
  61. *       or macros may be quickly located in any file by enclosing a key
  62. *       identification word in parentheses and placing the bookmarked
  63. *       word in an Index.  Version 1.8 includes macros using the new
  64. *       and *not- recommended* technique of a "macro reading a macro".
  65.  
  66. *       A theoretically unlimited number of macros (in excess of the
  67. *       limited 0.5k QConfig.dat buffer) located in files other than
  68. *       the current file can be quickly located and easily executed at
  69. *       any time using either @f, @6 or @7 while editing any file. (See
  70. *       bok001.qm for additional discussion).
  71.  
  72. *       For anyone using more than a few macros and who might be tight
  73. *       on QConfig macro buffer space, the macros in bok001.qm may be
  74. *       of interest; they are allowing me to have immediate access while
  75. *       editing any file, to quickly load and run over 300 macros in
  76. *       about 50 files compiled to more than 20,000 macro bytes -- and
  77. *       with 150 bytes QConfig macro buffer space to spare. I am still
  78. *       testing and improving these macros, and so far I'm encouraged.
  79. *       Beware, these macros are not for the feint of heart <grin> !
  80.  
  81. *       The techniques, necessary configuring, and use of these
  82. *       bookmark macros require a considerable knowlege of QMAC and
  83. *       QEdit macro language. The new techniques they involve have not
  84. *       been fully tested.  These are my first real effort to have a
  85. *       macro read a macro, a heretofore (and still) not recommended
  86. *       procedure. Until this "macro reading a macro" technique can be
  87. *       fully tested and proven to be viable, I do *not* advise the
  88. *       user use this technique in other macros without full knowledge
  89. *       of it's pitfalls and limitations.
  90.  
  91.  
  92. * (Configuration)  - MUST do
  93. * ---------------------------
  94.  
  95. *       In order to access files and/or invoke macros in different
  96. *       directories, all files listed in 'e-up.lst' MUST be configured
  97. *       for the user directory containing AMAC files.  My directory,
  98. *       e:\up, occurs over 100 times and must be changed using the
  99. *       following configuration procedure which takes a few minutes
  100. *       to do the search/replace and compile using QMAC:
  101.  
  102. *       1. Make a two letter directory on your hard drive named \UP.
  103. *          If this conflicts, then any two letter directory will
  104. *          suffice.
  105.  
  106. *       2. First expand all files in AMAC40.ZIP to \UP directory.
  107.  
  108. *       3. Change to \UP directory.
  109.  
  110. *       4. Replace 'e:\up\' with  [ dir:\ ] in all files in the file
  111. *          list 'e-up.lst' using SR.BAT search/replace batch file from
  112. *          SRCHxx.QM:
  113.  
  114. *                   SR.BAT  e:\up\  [ dir:\ ]  @e-up.lst  <enter>
  115.  
  116. *          e.g. if c:\up is your directory containing AMAC files:
  117.  
  118. *                   SR.BAT  e:\up\  c:\up\  @e-up.lst  <enter>
  119. *                                   ^^^^^^
  120.  
  121. *       5. After the search/replace is complete, exit QEdit and convert
  122. *          changed txtfiles to macfiles using QMAC with the following:
  123. *                   E-UP.BAT
  124.  
  125. *       6. Put the following bok001.qm macro in QCONFIG.DAT, changing
  126. *          dir:\ to your directory containing AMAC files:
  127.  
  128. *             @f macro_begin macroread "[ dir:\ ]bok001.mac" return
  129.  
  130. *          e.g.,
  131.  
  132. *             @f macro_begin macroread "c:\up\bok001.mac" return
  133. *                                       ^^^^^^
  134.  
  135. *       7. The following macros in bok001.qm should also be installed
  136. *          in QConfig.dat and then commented out of bok001.qm after
  137. *          installation.  They will then be available in any editing
  138. *          session as long as no subsequently installed macros have the
  139. *          same keys.
  140.  
  141. *          ^f1  Cycle Between Starting and Selected Files After Invoking @6
  142. *          @0   Save Current Macro Buffer, Read Previously Saved Macro Buffer
  143. *          @=   Read Current Txtfile Macros
  144. *          @-   Read Previously Saved Macro Buffer
  145.  
  146. *       8. Remove previous version of INDXxx.QM and INDXxx.MAC from
  147. *          your directory.
  148.  
  149. *       9. After completion of steps 4 and 5 above, changing c:\ to a
  150. *          ram drive in all macros in bok001.qm will increase macro
  151. *          execution speed, although this in not necessary.
  152.  
  153.  
  154. * (Using) Macros
  155. * ---------------
  156.  
  157. *       The following examples demonstrate the use of macros in
  158. *       bok001.qm using @6 and @f.  Macros to only read (txtfile
  159. *       not loaded) can be selected the same way as @6.
  160.  
  161. *       To execute bok001.qm macros, be sure Insert is ON and then:
  162.  
  163. *       1. Load BOOK18.QM into a QEdit window.
  164.  
  165. *       2. Read the macfile bok001.mac as follows:
  166. *             @f  <enter>
  167. *          Macros @f, @6, @7 and ^f1 are now loaded.
  168.  
  169. *       3. Run @6.  Cursor down to desired txtfile in INDXxx.QM to load
  170. *          the selected txtfile, and press <enter>.  At the next pause,
  171. *          cursor down to desired macro to load it's txtfile and read
  172. *          it's macros. Selecting @f will load subfile bok001.qm  and
  173. *          read it's macros, with the cursor positioned on a
  174. *          description of @f.
  175.  
  176. *       4. Press ^f1 to cycle between BOOK18.QM and bok001.qm
  177.  
  178. *       5. Press @6 again to load and read another set of macros.
  179.  
  180. *       6. Press @f now at any time to load and read bok001.qm macros.
  181. *          Macros @f, @6, @7 and ^f1 are now reloaded and ready to run
  182. *          while editing any file. Macros @f, @6, @7 and ^f1 may now
  183. *          be invoked while editing any file.
  184.  
  185.  
  186. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  187.  
  188. * (Other) Macros: See ALLMACRO.INF for other macros.  See also
  189. *                 JMPPOSxx.QM for macros to jump to positions within
  190. *                 and across files using position markers.
  191.  
  192.  
  193. * (Macros)
  194. * ---------
  195.  
  196. * 
  197. * -------------------------------------------------------------------------
  198. * @(1) Jump To First Word On Cursor Line "Marked" In The Document Below
  199. * -------------------------------------------------------------------------
  200. *
  201. *        @1 macro has 2 steps:
  202. *
  203. *        1. Press Alt and 1 at the same time. Line 1 is marked to
  204. *        highlight. Cursor down to desired line in Index.
  205. *
  206. *        2. Press Enter. The macro then jumps to the first word
  207. *        cursor line in the document below.
  208.  
  209. *        @1 differs from @f in that @1 will only find an Index item or
  210. *        macro in the current file.  @f will find them in an unlimited
  211. *        number of files.
  212.  
  213. @1 macrobegin
  214.         unmarkblock                     * Unmark any marked blocks
  215.         defaultwordset                  * In case altwordset on
  216.         begfile markline markline       * And highlight line 1
  217.         pause                           * Pause for Index selection
  218.         wordright markword              * Mark first word on line
  219.         copy                            * Copy word to scrap
  220.         endpara                         * Go to end of Index
  221.         find "(" paste ")"              *
  222.         return "I" return               * Find first marked word in doc
  223.     jfalse NOMARK:                      *
  224.         begline                         * If mark found go to begline
  225.         maketopofscreen scrollup        * Cursor on line 2                |a
  226.     jump END:                           *
  227.     NOMARK:                             *
  228.         begfile                         * If no mark found go to begfile
  229.     END:
  230. *
  231. * 32 bytes Tue  09-11-1990  11:19:51
  232. * 33 bytes Wed  06-26-1991  11:23:27 (TH @1, added defaultwordset)
  233. * 33 bytes Fri  07-05-1991  10:31:13 (TH @1, moved makectrofscreen down)
  234. * 33 bytes Wed  07-10-1991  10:11:24 (TH @1, moved makectrofscreen back up)
  235. * 34 bytes Sun  07-28-1991  15:48:33 (TH @1, changed found cursor pos |a)
  236.  
  237. * Here a QMAC compiled version of @1 that will fit on a single line in
  238. * QConfig.dat:
  239.  
  240. * @1      MacroBegin UnmarkBlock DefaultWordSet BegFile MarkLine
  241. *         MarkLine Pause WordRight MarkWord Copy EndPara Find "(" Paste
  242. *         ")" Return "I" Return JFalse Label0: BegLine MakeTopOfScreen
  243. *         ScrollUp Jump Label1: Label0: BegFile Label1:
  244. * 34 bytes Sun  07-28-1991  15:48:33 (TH @1, changed found cursor pos |a)
  245.  
  246. * This above version of @1 is 34 bytes. You may want to use the
  247. * following shorter version (22 bytes) where searching starts from
  248. * cursor line, not at the end of the first paragraph of the (Index), as
  249. * above:
  250.  
  251. * @1 macrobegin
  252. *        unmarkblock                    * unmark any marked blocks
  253. *        defaultwordset                 * in case altwordset on
  254. *        begfile                        * go to file begin endline
  255. *        markline                       * highlight to show 'on'
  256. *        markline                       *
  257. *        pause                          * pause for Index selection
  258. *        wordright markword             * mark first word on line
  259. *        copy                           * copy word to scrap
  260. *        find "(" paste ")" return      * find first marked word in doc
  261. *        return
  262. *        begline                        * if mark found go to begline
  263. *
  264. * 21 bytes Tue  09-11-1990  11:22:45 added markline
  265. * 22 bytes Wed  06-26-1991  11:23:27 (TH @1, added defaultwordset)
  266.  
  267. * 
  268. * -------------------------------------------------------------------------
  269. * @(4) Jump To First Word On Cursor Line "Marked" In The Document Below
  270. *      Positions Cursor On First Index Selection Line For Quicker Selection
  271. * -------------------------------------------------------------------------
  272.  
  273. * This macro is an alternate version of @1 that positions the cursor on
  274. * the first Index selection line instead of the top line as @1 does.
  275. * This enables the user to more quickly make a selection to jump to.
  276.  
  277. @4 macrobegin
  278.         unmarkblock                     * Unmark any marked blocks
  279.         defaultwordset                  * In case altwordset on
  280.         begfile                         *
  281.         endpara                         * Move to end of Index
  282.         markline                        * Mark it
  283.         begfile                         * Move to bof
  284.         find "(" return "L" return      * Locate first Index selection line
  285.     jfalse NOMARK:                      *
  286.         makectrofscreen                 * Show top of file
  287.         begfile                         * Move back to bof
  288.         unmarkblock markline markline   * And highlight line 1
  289.         prevposition                    * Move back to first selection line
  290.         begline                         * Cursor in col 1
  291.         pause                           * Pause for Index selection
  292.         wordright markword              * Mark first word on line
  293.         copy                            * Copy word to scrap
  294.         endpara                         * Go to end of Index
  295.         find "(" paste ")"              *
  296.         return "I" return               * Find first marked word in doc
  297.     jfalse NOMARK:                      *
  298.         begline                         * If mark found go to begline
  299.         maketopofscreen scrollup        * Cursor on line 2                |a
  300.     jump END:                           *
  301.     NOMARK:                             *
  302.         begfile                         * If no mark found go to begfile
  303.     END:
  304. *
  305. * 34 bytes Sun  07-28-1991  15:48:33 (TH @1)
  306. * 52 bytes Wed  07-31-1991  14:43:31 (TH @4 in BOOKxx.QM)
  307.  
  308. * Here's a QMAC compiled version of @4 that will fit on a single line in
  309. * QConfig.dat:
  310.  
  311. * @4      MacroBegin UnmarkBlock DefaultWordSet BegFile EndPara
  312. *         MarkLine BegFile Find "(" Return "L" Return JFalse Label0:
  313. *         MakeCtrOfScreen BegFile UnmarkBlock MarkLine MarkLine
  314. *         PrevPosition BegLine Pause WordRight MarkWord Copy EndPara
  315. *         Find "(" Paste ")" Return "I" Return JFalse Label1: BegLine
  316. *         MakeTopOfScreen ScrollUp Jump Label2: Label0: Label1: BegFile
  317. *         Label2:
  318. * 52 bytes Wed  07-31-1991  14:43:31 (TH @4)
  319.  
  320.  
  321. * 
  322. * ----------------------------------------------------------------------
  323. * @(2) Finds Word In Document, Adds () To Found Word And Returns To Index
  324. * ----------------------------------------------------------------------
  325. *
  326. *      @2 macro has 3 steps:
  327. *
  328. *       1. Press Alt and 2 at the same time. The macro finds first word
  329. *       on the cursor line in the document below. If first found word
  330. *       is not the desired occurrence, press F4 for next word or until
  331. *       the desired occurrence is found.
  332. *
  333. *       2. When the desired word and location are found, press Enter.
  334. *       The macro places () around desired found word and then return
  335. *       to the original word in the Index.
  336. *
  337. *       3. Press Enter again and the macro places () around the original
  338. *       word in the Index. The cursor ends at end of the marked word in
  339. *       the Index so comments may be added. Be careful not to mark the
  340. *       same word more than once or only the first occurrence of the word
  341. *       in the document will be found with @1 and @f.
  342. *
  343. @2      macrobegin                      *
  344.         defaultwordset                  * in case altwordset on
  345.         wordright markword              * mark first word on line
  346.         copy                            * copy word to scrap
  347.         find paste return "I" return    * find first word in doc          |a
  348.         pause                           * pause for Enter or F4
  349.        "("                              * place ( in front of word
  350.         markword                        * markword
  351.         gotoblockend ")"                * place ) at end of word
  352.         pause                           * pause for Enter if OK
  353.         begfile                         * go to file begin
  354.         find return delline return      * find selected word doc          |a
  355.         pause                           * pause for Enter if OK
  356.         markword                        * markword
  357.         gotoblockbeg "("                * place ( in front of word
  358.         gotoblockend ") "               * place ) at end of word
  359.         unmarkblock                     * unmark word
  360. *
  361. * 35 bytes Sat  07-28-1990  15:17:55
  362. * 36 bytes Wed  06-26-1991  12:13:45 (TH @2, added defaultwordset)
  363. * 38 bytes Sun  07-28-1991  16:24:04 (TH @2, changed Find's |a)
  364.  
  365. * 
  366. * ----------------------------------------------------------------------
  367. * @(3)  Puts Word @ Cursor In Index With () Around Marked Word And In Index
  368. * ----------------------------------------------------------------------
  369. *
  370. *        @3 macro has 2 steps:
  371. *
  372. *        1. Press Alt and 3 at the same time. Macro marks the word at the
  373. *        cursor in the document, then returns to the the end of the Index.
  374. *        The marked word in the document is then copied at the end of the
  375. *        Index with () around it. The cursor is at end of word so
  376. *        comments may be added in the Index.
  377. *
  378. *        2. Press Enter and the cursor returns to the beginning of
  379. *        the line of the marked word in the document.
  380. *
  381. @3      macrobegin                      *
  382.         defaultwordset                  * in case altwordset on
  383.         markword                        * mark word at cursor
  384.         gotoblockbeg "("                * place () around word
  385.         gotoblockend ")"                *
  386.         copy                            * copy word and ) to scrap
  387.         begfile                         * go to file begin
  388.         endpara                         * go to end of Index
  389.         addline                         * add one extra line              |
  390.         begline "*"                     * insert star in col 1 at eoi     |
  391.         cursorright                     * make one space                  |
  392.         "("                             * insert "("                      |a
  393.         paste                           * paste word and ")" to eoi       |
  394.         endline                         * insert ")" in end of word       |
  395.         cursorright                     * make one space                  |
  396.         unmarkblock makectrofscreen     * unmark word and ()              |
  397.         pause                           * pause for comments and if OK
  398.         begline wordright markword      * mark word
  399.         copy                            * copy word to scrap
  400.         find "(" paste ")" return return * return to word in doc
  401.         begline                         * go to line begin
  402. *
  403. * 42 bytes Sat  07-28-1990  15:18:04
  404. * 43 bytes Wed  06-26-1991  12:13:32 (TH @3, added defaultwordset)
  405. * 41 bytes Sun  07-28-1991  16:16:19 (TH @3, shortened |a)
  406.  
  407. * 
  408. * ----------------------------------------------------------------------
  409. * (f4) Continues Until Desired Word Is Found Using @2
  410. * ----------------------------------------------------------------------
  411. *
  412. *       (see @2 for use)
  413. *
  414. f4      repeatfind                      * repeat find until desired word
  415.                                         *  & location are found
  416. * 5 bytes Sat  07-28-1990  15:18:17 (TH @4)
  417.  
  418.  
  419. * (QEdit)    is not a marked Index word
  420. * (unmarked) is not a marked Index word
  421. * (be)       is not a marked Index word
  422. * (window)   is not a marked Index word
  423.  
  424. * (Version) History
  425. * -------------------
  426. *   1.0 - initial
  427. *   1.1 - changed document
  428. *   1.2 - modified @1 to keep normal cursor line color before selecting
  429. *         an indexed word. Macro now does not find marked words in Index.
  430. *   1.3 - changed document BOOK13.QM
  431. *   1.3a- Changed other file names in series, this is an update.
  432. *   1.4 - Changed down arrow #25 to ! in @1.
  433. *       - Changed .LST and .QL
  434. *   1.5 - Modified @1 to highlight line 1 rather than ! at end
  435. *   1.5a- Modified this file.
  436. *   1.5b- Modified this file and added START.BAT.
  437. *   1.6 - Modified @1, @2 and @3 to start with defaultwordset.
  438. *       - Moved makectrofsccreen in @1 down.
  439. *   1.6a- Added @space to update @f in files.
  440. *       - Added @f to load and read an unlimited number of macros.
  441. *       - Included v1.6a in AMAC39.ZIP, July 21, 1991.
  442. *   1.7 - Changed @space to @5. @space key can only be used if
  443. *         NewKey is loaded,  July 23, 1991.
  444. *       - Added @6 and @7 in bok001.qm to load and read macros from
  445. *         an Index of all text files containing macros,  July 25, 1991.
  446. *       - Modified @1, @2 ans @3,  July 28, 1991.
  447. *       - @f was not reading subfile macros if key was not found.
  448. *         Corrected and further modified, July 28, 1991.
  449. *       - Included in AMAC39A.ZIP, July 29, 1991.
  450. *   1.8 - Added keys capability in INDXxx.QM.                          7/30/91
  451. *       - Added @4, 'quicker' version of @1 IN BOOKxx.QM               7/31/91
  452. *       - Added @0, @= and @- to bok001.qm.                            7/31/91
  453. *       - Added 'Save Current Macro Buffer' to @6, @7 & @f bok001.qm.   8/1/91
  454. *       - Added @8 to read only subfile macros at cursor line.          8/4/91
  455. *
  456. *
  457. *
  458. *
  459. *
  460. *
  461. *
  462. *
  463.